package com.rhs.service.impl;

import com.rhs.domain.User;
import com.rhs.mapper.UserMapper;
import com.rhs.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
@Service
@Transactional
public class UserServiceImpl implements UserService {

    //注入mapper
    @Autowired
    private UserMapper userMapper;
    @Override
    public List<User> selectAll() {
        return userMapper.selectAll();
    }

    @Override
    public List<User> selectByWhere(User user) {
        return  userMapper.selectByWhere(user);
    }

    @Override
    public void deleteByIds(int[] ids) {
userMapper.deleteByIds(ids);
    }

    @Override
    public void insert(User user) {
        userMapper.insert(user);
    }

    @Override
    public void delete(int uid) {
        userMapper.delete(uid);
    }

    @Override
    public User selectById(int uid) {
        return userMapper.selectById(uid);
    }

    @Override
    public void update(User user) {

        userMapper.update(user);
    }
}
